﻿using System;

namespace RotovapPlatform.Domain.Common
{
	/// <summary>
	/// 操作失败异常
	/// </summary>
	public class OperationFailedException : Exception
	{
		/// <summary>
		/// 操作结果
		/// </summary>
		public OperationResult Result { get; }

		/// <summary>
		/// 初始化操作失败异常
		/// </summary>
		/// <param name="message">错误消息</param>
		/// <param name="result">操作结果</param>
		public OperationFailedException(string message, OperationResult result)
			: base(message)
		{
			Result = result;
		}

		/// <summary>
		/// 初始化操作失败异常
		/// </summary>
		/// <param name="message">错误消息</param>
		/// <param name="result">操作结果</param>
		/// <param name="innerException">内部异常</param>
		public OperationFailedException(string message, OperationResult result, Exception innerException)
			: base(message, innerException)
		{
			Result = result;
		}
	}
}